#include "gpio.hpp"
#include "system.hpp"

class __Pin : public Pin {
public:
    __Pin(int port_number,int pin_number);
    virtual ~__Pin();
    virtual bool open(void);
    virtual bool close(void);
    virtual void set(bool status);
    virtual bool get(void);

    virtual bool setMode(Mode mode);
    virtual Mode getMode(void);
    virtual bool setDriveType(DriveType drive_type);
    virtual DriveType getDriveType(void);
    virtual bool setPullType(PullType pull_type);
    virtual PullType getPullType(void);

    virtual bool registEvent(EventType event_type,EventCallback event_callback);
    virtual bool unregistEvent(EventType event_type);
private:
    int port_number;
    int pin_number;
    Mode mode;
    DriveType drive_type;
    PullType pull_type;
    bool status;
};

__Pin::__Pin(int port_number,int pin_number){
    this->port_number = port_number;
    this->pin_number = pin_number;
    this->status = false;
}

__Pin::~__Pin(){
    
}

bool __Pin::open(){

}

bool __Pin::close(){

}

void __Pin::set(bool status){

}

bool __Pin::get(){

}

bool __Pin::setMode(Mode mode){

}

Pin::Mode __Pin::getMode(){

}

bool __Pin::setDriveType(DriveType drive_type){

}

Pin::DriveType __Pin::getDriveType(){

}

bool __Pin::setPullType(PullType pull_type){

}

Pin::PullType __Pin::getPullType(){

}

bool __Pin::registEvent(EventType event_type,EventCallback event_callback){

}

bool __Pin::unregistEvent(EventType event_type){

}

class __Port : public Port {
public:
    __Port(int port_number);
    virtual ~__Port();
    virtual bool open(void);
    virtual bool close(void);
    virtual int read(void *buff,int size);
    virtual int write(void *buff,int size);

    virtual Pin *getPin(int pin_number);
private:
    __Pin *pins[16];
    int port_number;
};

__Port::__Port(int port_number){
    this->port_number = port_number;
}

__Port::~__Port(){

}

bool __Port::open(){

}

bool __Port::close(){

}

int __Port::read(void *buff,int size){

}

int __Port::write(void *buff,int size){

}

Pin *__Port::getPin(int pin_number){

}

Port *ST::Port::getInstance(int port_number){

}